//
//  ChoseDefaultAddressView.m
//  LoveTrail
//
//  Created by giantumbrella on 15/6/26.
//  Copyright (c) 2015年 赵娟. All rights reserved.
//

#import "ChoseDefaultAddressView.h"
#import "CommonMacro.h"
@interface ChoseDefaultAddressView()
@property (nonatomic,strong) UIView *reciveAddreView;
@property (nonatomic,strong) UIView *detailLabel;
@property (nonatomic,strong) UILabel *defaultLabel;
@property (nonatomic,strong) UIButton *changeAddreButton;
@property (nonatomic,strong) UILabel *bigNameLabel;
@property (nonatomic,strong) UILabel *nameLabel;
@property (nonatomic,strong) UILabel *cityLabel;
@property (nonatomic,strong) UILabel *zipCodeLabel;
@property (nonatomic,strong) UILabel *genderLabel;
@property (nonatomic,strong) UILabel *phoneNumLabel;
@property (nonatomic,strong) UILabel *addressLabel;

@end
@implementation ChoseDefaultAddressView

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self createSubviews];
    }
    return self;
}

- (void)createSubviews
{
    //2.2具体内容
    self.detailLabel = [[UIView alloc] initWithFrame:CGRectMake(10, 3, SCREEN_WIDTH-20, 154)];
    [self addSubview:self.detailLabel];
    self.detailLabel.backgroundColor = UIColorWithRGBA(252, 237, 163, 1);
    self.detailLabel.layer.cornerRadius = 3;
    self.detailLabel.clipsToBounds = YES;
    self.detailLabel.layer.borderColor = UIColorWithRGBA(212, 212, 214, 1).CGColor;
    self.detailLabel.layer.borderWidth = 1;
    //众坐标
    CGFloat margginX = 10;
    CGFloat margginY = 5;
    CGFloat labelX = 10;
    CGFloat labelY = 5;
    CGFloat font = 14;
    CGFloat labelH = (self.detailLabel.frame.size.height-labelY-4*margginY)/4;
    CGFloat labelW = (self.detailLabel.frame.size.width-labelX-2*margginX)/3;
    //1.大名
    self.bigNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(margginX, margginY, labelW, labelH)];
    [self.detailLabel addSubview:self.bigNameLabel];
    self.bigNameLabel.text = @"Linda";
    self.bigNameLabel.textColor = UIColorWithRGBA(248, 136, 40, 1);
    self.bigNameLabel.font = [UIFont boldSystemFontOfSize:20];
    
    //2.姓名
    self.nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX, self.bigNameLabel.frame.size.height+margginY, labelW, labelH)];
    [self.detailLabel addSubview:self.nameLabel];
    self.nameLabel.text = [NSString stringWithFormat:@"姓名：Linda"];
    self.nameLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.nameLabel.font = [UIFont boldSystemFontOfSize:font];
    
    //3.城市
    self.cityLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.nameLabel.frame.size.width+self.nameLabel.frame.origin.x+margginX, labelY+labelH, labelW, labelH) ];
    [self.detailLabel addSubview:self.cityLabel];
    self.cityLabel.text = [NSString stringWithFormat:@"城市：杭州"];
    self.cityLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.cityLabel.font = [UIFont boldSystemFontOfSize:font];
    
    //4.邮编
    self.zipCodeLabel = [[UILabel alloc] initWithFrame:CGRectMake((labelW+margginX)*2, labelH+labelY, labelW, labelH)];
    [self.detailLabel addSubview:self.zipCodeLabel];
    self.zipCodeLabel.text = [NSString stringWithFormat:@"邮编：325151"];
    self.zipCodeLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.zipCodeLabel.font = [UIFont boldSystemFontOfSize:font];
    
    //5.性别
    self.genderLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX, (labelH+margginY)*2+labelY, labelW, labelH)];
    [self.detailLabel addSubview:self.genderLabel];
    self.genderLabel.text = [NSString stringWithFormat:@"性别：女"];
    self.genderLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.genderLabel.font = [UIFont boldSystemFontOfSize:font];
    
    //6.手机号
    self.phoneNumLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX+labelW+margginX, (labelH+margginY)*2+labelY, labelW*2, labelH)];
    [self.detailLabel addSubview:self.phoneNumLabel];
    self.phoneNumLabel.text = [NSString stringWithFormat:@"手机：18356153208"];
    self.phoneNumLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.phoneNumLabel.font = [UIFont boldSystemFontOfSize:font];
    
    //7.地址
    self.addressLabel = [[UILabel alloc] initWithFrame:CGRectMake(labelX, (labelH+margginY)*3, self.detailLabel.frame.size.width-labelX*2+9, labelH+10)];
    [self.detailLabel addSubview:self.addressLabel];
    self.addressLabel.text = [NSString stringWithFormat:@"地址：浙江省杭州市西湖区西溪科创元11庄202室"];
    self.addressLabel.numberOfLines = 0;
    [self.addressLabel sizeToFit];
    self.addressLabel.textColor = UIColorWithRGBA(248, 162, 51, 1);
    self.addressLabel.font = [UIFont boldSystemFontOfSize:font];

}
@end
